<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>props基础使用</title>
</head>

<body>
    <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
    <div id="Application">
        <child number="100"></child>
    </div>
    <script>
        const App = Vue.createApp({
            setup() {
                return {
                }
            },
        });

        //子组件
        const childBlock = {
            props: {
                number: {
                    type: Number
                }
            },
            setup(props) {
                console.log(props.value);//100
                const msg = Vue.ref("我是子组件")
                return {
                    msg
                }

            },

            template: '{{number}}{{msg}}'
        }
        App.component("child", childBlock);

        //挂载
        App.mount("#Application");
    </script>
</body>

</html>